# First things, first. Import the wxPython package.
import wx
from docx import Document


def gide_to_name(**gid):
    re = 0
    for i in gid:
        re += gid[i]
    return re


if __name__ == '__main__':
    # parm = {'a':1,'b':2}
    # print(gide_to_name(**parm))

    # doc = Document('/Users/lujiewen/asiainfo-sec/fujian-data/备案信息表-模板.docx')
    #
    # for table in doc.tables:
    #     max_column = len(table.columns)
    #     for row in table.rows:
    #         print('---------------------')
    #         idx = 0
    #         while idx < max_column:
    #             cell = table.cell(row._index, idx)
    #
    #             for paragraph in cell.paragraphs:
    #                 for run in paragraph.runs:
    #                     # print(run._element.__dict__)
    #                     print(run.text)
    #
    #             # content = cell.text.replace('\n', '')
    #             # print(content)
    #             idx += cell.grid_span if cell.grid_span else 1

                # for cell in range():
                #     print()
            # for cell in row.cells:
            #     v_merge = cell._element.vMerge
            #     # print(cell.text)
            #     if v_merge is not None:
            #         print(v_merge)
            #     print(cell.grid_span)
            # for paragraph in cell.paragraphs:
            #     for run in paragraph.runs:
            #         print(run.text)

    # text = process('/Users/lujiewen/asiainfo-sec/fujian-data/备案信息表-模板.docx')
    # print(text)

    # Next, create an application object.
    app = wx.App()

    # Then a frame.
    frm = wx.Frame(None, title="Hello World")

    # Show it.
    frm.Show()

    # Start the event loop.
    app.MainLoop()
